package 剑指offer.Month7_07.day11;

public class 斐波那契数列 {
    public int Fibonacci(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            if(i == 0 || i == 1){
                arr[i] = 1;
            }else{
                arr[i] = arr[i - 1] + arr[i - 2];
            }
        }
        return arr[n - 1];
    }
}
